package com.yituo.mjworld.mvc.entity.web;

import com.yituo.mjworld.core.web.core.BaseForm;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "web_user", schema = "web_mojianworld_server", catalog = "")
public class WebUser extends BaseForm{
  private String id;
  private String account;
  private String password;
  private String nickname;
  private String wxId;
  private String headImage;
  private String telphone;
  private String email;
  private Date registerDate;
  private Date lastLoginDate;
  private int rule;
  private int scale;
  private String referrer;
  private byte status;

  @Id
  @Column(name = "id", nullable = false, length = 36)
  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  @Basic
  @Column(name = "account", nullable = false, length = 50)
  public String getAccount() {
    return account;
  }

  public void setAccount(String account) {
    this.account = account;
  }

  @Basic
  @Column(name = "password", nullable = false, length = 50)
  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  @Basic
  @Column(name = "nickname", nullable = true, length = -1)
  public String getNickname() {
    return nickname;
  }

  public void setNickname(String nickname) {
    this.nickname = nickname;
  }

  @Basic
  @Column(name = "wxId", nullable = true, length = 50)
  public String getWxId() {
    return wxId;
  }

  public void setWxId(String wxId) {
    this.wxId = wxId;
  }

  @Basic
  @Column(name = "headImage", nullable = true, length = 150)
  public String getHeadImage() {
    return headImage;
  }

  public void setHeadImage(String headImage) {
    this.headImage = headImage;
  }

  @Basic
  @Column(name = "telphone", nullable = true, length = 11)
  public String getTelphone() {
    return telphone;
  }

  public void setTelphone(String telphone) {
    this.telphone = telphone;
  }

  @Basic
  @Column(name = "email", nullable = true, length = 50)
  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  @Basic
  @Column(name = "registerDate", nullable = false)
  public Date getRegisterDate() {
    return registerDate;
  }

  public void setRegisterDate(Date registerDate) {
    this.registerDate = registerDate;
  }

  @Basic
  @Column(name = "lastLoginDate", nullable = true)
  public Date getLastLoginDate() {
    return lastLoginDate;
  }

  public void setLastLoginDate(Date lastLoginDate) {
    this.lastLoginDate = lastLoginDate;
  }

  @Basic
  @Column(name = "rule", nullable = false)
  public int getRule() {
    return rule;
  }

  public void setRule(int rule) {
    this.rule = rule;
  }

  @Basic
  @Column(name = "scale", nullable = false)
  public int getScale() {
    return scale;
  }

  public void setScale(int scale) {
    this.scale = scale;
  }

  @Basic
  @Column(name = "referrer", nullable = false, length = 36)
  public String getReferrer() {
    return referrer;
  }

  public void setReferrer(String referrer) {
    this.referrer = referrer;
  }

  @Basic
  @Column(name = "status", nullable = false)
  public byte getStatus() {
    return status;
  }

  public void setStatus(byte status) {
    this.status = status;
  }


  @Override
  public int hashCode() {
    int result = id != null ? id.hashCode() : 0;
    result = 31 * result + (account != null ? account.hashCode() : 0);
    result = 31 * result + (password != null ? password.hashCode() : 0);
    result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
    result = 31 * result + (wxId != null ? wxId.hashCode() : 0);
    result = 31 * result + (headImage != null ? headImage.hashCode() : 0);
    result = 31 * result + (telphone != null ? telphone.hashCode() : 0);
    result = 31 * result + (email != null ? email.hashCode() : 0);
    result = 31 * result + (registerDate != null ? registerDate.hashCode() : 0);
    result = 31 * result + (lastLoginDate != null ? lastLoginDate.hashCode() : 0);
    result = 31 * result + rule;
    result = 31 * result + scale;
    result = 31 * result + (referrer != null ? referrer.hashCode() : 0);
    result = 31 * result + (int) status;
    return result;
  }

  @Override
  public boolean validate() {
    return defaultValidate();
  }
}
